<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/forum_edit.css" />
	</head>
	<body>
			<header>
			<div class="tophead">
				<div class="logo">
					<a href="#">世说新语</a>
				</div>
				<div id="mnav">
					<h2><span class="navicon"></span></h2>
					<ul>
						<li>
							<a href="#">网站首页</a>
						</li>
						<li>
							<a href="thrift_shop.html">二手商城</a>
						</li>
						<li>
							<a href="forum.html">论坛</a>
						</li>
						<li>
							<a href="endless_study.html">学无止境</a>
						</li>
						<li>
							<a href="#">注册</a>
						</li>
						<li>
							<a href="#">登录</a>
						</li>
					</ul>
				</div>
				<nav class="topnav" id="topnav">
					<ul>
						<li class="topnav_li user_function_li">
							<a class="topnav_a" href="#">
								<img src="img/a2.jpg" class="user_img" />
							</a>
							<div class="user_function_div">
								<div class="user_function_img_parent">
									<img src="img/a2.jpg" class="user_img" />
									<h3 class="user_name">行船全靠浪</h3>
								</div>
								<div>
									<ul class="user_function_ul">
										<li>
											<a href="#">个人中心</a>
										</li>
										<li>
											<a href="#">文章管理</a>
										</li>
										<li>
											<a href="#">贴文管理</a>
										</li>
										<li>
											<a href="#">商城管理</a>
										</li>
									</ul>
								</div>
								<a class="user_logout" href="#">安全退出</a>
							</div>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="#">注册</a>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="endless_study.html">学无止境</a>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="forum.html">论坛</a>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="thrift_shop.html">二手商城</a>
						</li>

						<li class="topnav_li">
							<a class="topnav_a" href="#">网站首页</a>
						</li>

					</ul>
				</nav>
			</div>
		</header>
		<h3 class="zyq-location-h3">
				<a href="forum.html">&lt;返回</a>
				<span class="f_r">您的当前位置是：论坛/编辑</span>
		</h3>
		<article>
			<div class="row">

				<div class="forum_edit_left">
					<h4 class="forum_h4">文章发表</h4>
					<div class="forum_div">
						<div class="forum_title_parent">
							<label>文章标题&nbsp;:&nbsp;&nbsp;<input type="text" placeholder="请输入帖子的标题" name="forum_title" class="forum_title " id="forum_title" /></label>
						</div>
						
						<div id="forum_content">

						</div>
						<div style="overflow: hidden;">
							<button class="forum_button">发表</button>
						</div>
					</div>
					
				
				</div>
				<div class="forum_edit_right">
					<div class="forum_hot_article">
					<h3>论坛热议榜</h3>
					<ul>
						<li><span class="forum_hot_article_order forum_hot_article_order_active">1</span>
							<a href="#" class="forum_hot_article_a">黄河之水天上来</a><span class="forum_hot_article_num">20000</span></li>
						<li><span class="forum_hot_article_order forum_hot_article_order_active">2</span>
							<a href="#" class="forum_hot_article_a">故人西辞黄鹤楼</a><span class="forum_hot_article_num">10000</span></li>
						<li><span class="forum_hot_article_order forum_hot_article_order_active">3</span>
							<a href="#" class="forum_hot_article_a">孤帆远影碧空尽</a><span class="forum_hot_article_num">5000</span></li>
						<li><span class="forum_hot_article_order">4</span>
							<a href="#" class="forum_hot_article_a">唯见长江天际流</a><span class="forum_hot_article_num">2000</span></li>
						<li><span class="forum_hot_article_order">5</span>
							<a href="#" class="forum_hot_article_a">黄河之水天上来</a><span class="forum_hot_article_num">20000</span></li>
						<li><span class="forum_hot_article_order">6</span>
							<a href="#" class="forum_hot_article_a">故人西辞黄鹤楼</a><span class="forum_hot_article_num">10000</span></li>
						<li><span class="forum_hot_article_order">7</span>
							<a href="#" class="forum_hot_article_a">孤帆远影碧空尽</a><span class="forum_hot_article_num">5000</span></li>
						<li><span class="forum_hot_article_order">8</span>
							<a href="#" class="forum_hot_article_a">唯见长江天际流</a><span class="forum_hot_article_num">2000</span></li>
					</ul>
				</div>
					<div class="forum_authority_parent">
						<h4>官方微信</h4>
						<img src="img/b07.jpg" class="forum_authority_core" />
						<p class="forum_authority_title">仲恺校园官方二维码</p>
					</div>
				</div>
			</div>
		</article>
		<footer>
			<p>Design by
				<a href="/">琪哥个人博客</a>
				<a href="/">蜀ICP备11002373号-1</a>
			</p>
		</footer>
		<script type="text/javascript" src="js/jquery.min.js" ></script>
		<script type="text/javascript" src="js/wangEditor.min.js" ></script>
		<script type="text/javascript" src="js/base.js"></script>
		<script type="text/javascript">
			var E = window.wangEditor;
			var editor = new E("#forum_content");
			editor.customConfig.menus = [
				'italic',
				'underline',
				'foreColor', // 文字颜色
				'emoticon', // 表情
				'image', 
				'undo', // 撤销
				
			];
			editor.create();
			$(".forum_button").click(function(){
				$.post(
					"http://localhost:8080/campus/forum/addForum.do",
					{"forum_title":$("#forum_title").val(),
					 "forum_content":editor.txt.html(),
					},
					function(data){
						if(data=="用户未登录"){
							alert("请先登录");
							return;
						}else if(data=="发表帖子成功"){
							alert("发表成功");
							$("#forum_title").val("");
							editor.txt.html("");
							return;
						}else{
							alert("发表失败，请重试");
							return;
						}
					}
				);
			});
		</script>
	</body>
</html>
